<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gmime-utils: GMime 3.0 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GMime 3.0 Reference Manual">
<link rel="up" href="core.html" title="Part III. GMime Core Reference">
<link rel="prev" href="gmime-gmime-encodings.html" title="gmime-encodings">
<link rel="next" href="gmime-GMimeReferences.html" title="GMimeReferences">
<meta name="generator" content="GTK-Doc V1.32 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#gmime-gmime-utils.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="core.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gmime-gmime-encodings.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gmime-GMimeReferences.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gmime-gmime-utils"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gmime-gmime-utils.top_of_page"></a>gmime-utils</span></h2>
<p>gmime-utils — MIME utility functions</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gmime-gmime-utils.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">GDateTime</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-header-decode-date" title="g_mime_utils_header_decode_date ()">g_mime_utils_header_decode_date</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-header-format-date" title="g_mime_utils_header_format_date ()">g_mime_utils_header_format_date</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-generate-message-id" title="g_mime_utils_generate_message_id ()">g_mime_utils_generate_message_id</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-decode-message-id" title="g_mime_utils_decode_message_id ()">g_mime_utils_decode_message_id</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-header-printf" title="g_mime_utils_header_printf ()">g_mime_utils_header_printf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-quote-string" title="g_mime_utils_quote_string ()">g_mime_utils_quote_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-unquote-string" title="g_mime_utils_unquote_string ()">g_mime_utils_unquote_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-text-is-8bit" title="g_mime_utils_text_is_8bit ()">g_mime_utils_text_is_8bit</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="returnvalue">GMimeContentEncoding</span></a>
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-best-encoding" title="g_mime_utils_best_encoding ()">g_mime_utils_best_encoding</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-decode-8bit" title="g_mime_utils_decode_8bit ()">g_mime_utils_decode_8bit</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-header-decode-text" title="g_mime_utils_header_decode_text ()">g_mime_utils_header_decode_text</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-header-encode-text" title="g_mime_utils_header_encode_text ()">g_mime_utils_header_encode_text</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-header-decode-phrase" title="g_mime_utils_header_decode_phrase ()">g_mime_utils_header_decode_phrase</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-header-encode-phrase" title="g_mime_utils_header_encode_phrase ()">g_mime_utils_header_encode_phrase</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-structured-header-fold" title="g_mime_utils_structured_header_fold ()">g_mime_utils_structured_header_fold</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-unstructured-header-fold" title="g_mime_utils_unstructured_header_fold ()">g_mime_utils_unstructured_header_fold</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gmime-gmime-utils.html#g-mime-utils-header-unfold" title="g_mime_utils_header_unfold ()">g_mime_utils_header_unfold</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gmime-gmime-utils.description"></a><h2>Description</h2>
<p>Utility functions to parse, encode and decode various MIME tokens
and encodings.</p>
</div>
<div class="refsect1">
<a name="gmime-gmime-utils.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="g-mime-utils-header-decode-date"></a><h3>g_mime_utils_header_decode_date ()</h3>
<pre class="programlisting"><span class="returnvalue">GDateTime</span> *
g_mime_utils_header_decode_date (<em class="parameter"><code>const <span class="type">char</span> *str</code></em>);</pre>
<p>Parses the rfc822 date string.</p>
<div class="refsect3">
<a name="g-mime-utils-header-decode-date.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>input date string</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-header-decode-date.returns"></a><h4>Returns</h4>
<p>the <span class="type">GDateTime</span> representation of the date
string specified by <em class="parameter"><code>str</code></em>
or <code class="literal">NULL</code> on error. </p>
<p><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>][<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-header-format-date"></a><h3>g_mime_utils_header_format_date ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_header_format_date (<em class="parameter"><code><span class="type">GDateTime</span> *date</code></em>);</pre>
<p>Allocates a string buffer containing the rfc822 formatted date
string represented by <em class="parameter"><code>date</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-utils-header-format-date.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>date</p></td>
<td class="parameter_description"><p>a <span class="type">GDateTime</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-header-format-date.returns"></a><h4>Returns</h4>
<p> a valid string representation of the date.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-generate-message-id"></a><h3>g_mime_utils_generate_message_id ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_generate_message_id (<em class="parameter"><code>const <span class="type">char</span> *fqdn</code></em>);</pre>
<p>Generates a unique Message-Id.</p>
<div class="refsect3">
<a name="g-mime-utils-generate-message-id.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>fqdn</p></td>
<td class="parameter_description"><p>Fully qualified domain name</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-generate-message-id.returns"></a><h4>Returns</h4>
<p> a unique string in an addr-spec format suitable for use as
a Message-Id.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-decode-message-id"></a><h3>g_mime_utils_decode_message_id ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_decode_message_id (<em class="parameter"><code>const <span class="type">char</span> *message_id</code></em>);</pre>
<p>Decodes a msg-id as defined by rfc822.</p>
<div class="refsect3">
<a name="g-mime-utils-decode-message-id.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>message_id</p></td>
<td class="parameter_description"><p>string containing a message-id</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-decode-message-id.returns"></a><h4>Returns</h4>
<p> the addr-spec portion of the msg-id.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-header-printf"></a><h3>g_mime_utils_header_printf ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_header_printf (<em class="parameter"><code><a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> *options</code></em>,
                            <em class="parameter"><code><a class="link" href="gmime-GMimeFormatOptions.html#GMimeFormatOptions" title="GMimeFormatOptions"><span class="type">GMimeFormatOptions</span></a> *format</code></em>,
                            <em class="parameter"><code>const <span class="type">char</span> *text</code></em>,
                            <em class="parameter"><code>...</code></em>);</pre>
<p>Allocates a buffer containing a formatted header specified by the
<em class="parameter"><code>Varargs</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-utils-header-printf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>options</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-GMimeFormatOptions.html#GMimeFormatOptions" title="GMimeFormatOptions"><span class="type">GMimeFormatOptions</span></a> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>text with printf-style formatters</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>arguments</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-header-printf.returns"></a><h4>Returns</h4>
<p> an allocated string containing the folded header specified
by <em class="parameter"><code>text</code></em>
and the following arguments.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-quote-string"></a><h3>g_mime_utils_quote_string ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_quote_string (<em class="parameter"><code>const <span class="type">char</span> *str</code></em>);</pre>
<p>Quotes <em class="parameter"><code>string</code></em>
 as needed according to the rules in rfc2822.</p>
<div class="refsect3">
<a name="g-mime-utils-quote-string.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>input string</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-quote-string.returns"></a><h4>Returns</h4>
<p> an allocated string containing the escaped and quoted (if
needed to be) input string. The decision to quote the string is
based on whether or not the input string contains any 'specials'
as defined by rfc2822.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-unquote-string"></a><h3>g_mime_utils_unquote_string ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_mime_utils_unquote_string (<em class="parameter"><code><span class="type">char</span> *str</code></em>);</pre>
<p>Unquotes and unescapes a string.</p>
<div class="refsect3">
<a name="g-mime-utils-unquote-string.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>input string</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-text-is-8bit"></a><h3>g_mime_utils_text_is_8bit ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
g_mime_utils_text_is_8bit (<em class="parameter"><code>const unsigned <span class="type">char</span> *text</code></em>,
                           <em class="parameter"><code><span class="type">size_t</span> len</code></em>);</pre>
<p>Determines if <em class="parameter"><code>text</code></em>
 contains 8bit characters within the first <em class="parameter"><code>len</code></em>

bytes.</p>
<div class="refsect3">
<a name="g-mime-utils-text-is-8bit.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>text to check for 8bit chars. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/array"><span class="acronym">array</span></a> length=len][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> guint8]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>text length</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-text-is-8bit.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the text contains 8bit characters or <code class="literal">FALSE</code>
otherwise.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-best-encoding"></a><h3>g_mime_utils_best_encoding ()</h3>
<pre class="programlisting"><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="returnvalue">GMimeContentEncoding</span></a>
g_mime_utils_best_encoding (<em class="parameter"><code>const unsigned <span class="type">char</span> *text</code></em>,
                            <em class="parameter"><code><span class="type">size_t</span> len</code></em>);</pre>
<p>Determines the best content encoding for the first <em class="parameter"><code>len</code></em>
 bytes of
<em class="parameter"><code>text</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-utils-best-encoding.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>text to encode. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/array"><span class="acronym">array</span></a> length=len][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> guint8]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>text length</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-best-encoding.returns"></a><h4>Returns</h4>
<p> a <a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="type">GMimeContentEncoding</span></a> that is determined to be the best
encoding type for the specified block of text. ("best" in this
particular case means smallest output size)</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-decode-8bit"></a><h3>g_mime_utils_decode_8bit ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_decode_8bit (<em class="parameter"><code><a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> *options</code></em>,
                          <em class="parameter"><code>const <span class="type">char</span> *text</code></em>,
                          <em class="parameter"><code><span class="type">size_t</span> len</code></em>);</pre>
<p>Attempts to convert text in an unknown 8bit/multibyte charset into
UTF-8 by finding the charset which will convert the most bytes into
valid UTF-8 characters as possible. If no exact match can be found,
it will choose the best match and convert invalid byte sequences
into question-marks (?) in the returned string buffer.</p>
<div class="refsect3">
<a name="g-mime-utils-decode-8bit.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>options</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>input text in
unknown 8bit/multibyte character set. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/array"><span class="acronym">array</span></a> length=len][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> guint8]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>input text length</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-decode-8bit.returns"></a><h4>Returns</h4>
<p> a UTF-8 string representation of <em class="parameter"><code>text</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-header-decode-text"></a><h3>g_mime_utils_header_decode_text ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_header_decode_text (<em class="parameter"><code><a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> *options</code></em>,
                                 <em class="parameter"><code>const <span class="type">char</span> *text</code></em>);</pre>
<p>Decodes an rfc2047 encoded 'text' header.</p>
<div class="refsect3">
<a name="g-mime-utils-header-decode-text.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>header text to decode</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>options</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-header-decode-text.returns"></a><h4>Returns</h4>
<p> a newly allocated UTF-8 string representing the the decoded
header.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-header-encode-text"></a><h3>g_mime_utils_header_encode_text ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_header_encode_text (<em class="parameter"><code><a class="link" href="gmime-GMimeFormatOptions.html#GMimeFormatOptions" title="GMimeFormatOptions"><span class="type">GMimeFormatOptions</span></a> *options</code></em>,
                                 <em class="parameter"><code>const <span class="type">char</span> *text</code></em>,
                                 <em class="parameter"><code>const <span class="type">char</span> *charset</code></em>);</pre>
<p>Encodes a 'text' header according to the rules in rfc2047.</p>
<div class="refsect3">
<a name="g-mime-utils-header-encode-text.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>options</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-GMimeFormatOptions.html#GMimeFormatOptions" title="GMimeFormatOptions"><span class="type">GMimeFormatOptions</span></a> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>text</p></td>
<td class="parameter_description"><p>text to encode</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>charset</p></td>
<td class="parameter_description"><p>the charset to use or <code class="literal">NULL</code> to use the default. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-header-encode-text.returns"></a><h4>Returns</h4>
<p> the encoded header. Useful for encoding
headers like "Subject".</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-header-decode-phrase"></a><h3>g_mime_utils_header_decode_phrase ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_header_decode_phrase (<em class="parameter"><code><a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> *options</code></em>,
                                   <em class="parameter"><code>const <span class="type">char</span> *phrase</code></em>);</pre>
<p>Decodes an rfc2047 encoded 'phrase' header.</p>
<div class="refsect3">
<a name="g-mime-utils-header-decode-phrase.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>phrase</p></td>
<td class="parameter_description"><p>header to decode</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>options</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-header-decode-phrase.returns"></a><h4>Returns</h4>
<p> a newly allocated UTF-8 string representing the the decoded
header.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-header-encode-phrase"></a><h3>g_mime_utils_header_encode_phrase ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_header_encode_phrase (<em class="parameter"><code><a class="link" href="gmime-GMimeFormatOptions.html#GMimeFormatOptions" title="GMimeFormatOptions"><span class="type">GMimeFormatOptions</span></a> *options</code></em>,
                                   <em class="parameter"><code>const <span class="type">char</span> *phrase</code></em>,
                                   <em class="parameter"><code>const <span class="type">char</span> *charset</code></em>);</pre>
<p>Encodes a 'phrase' header according to the rules in rfc2047.</p>
<div class="refsect3">
<a name="g-mime-utils-header-encode-phrase.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>options</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-GMimeFormatOptions.html#GMimeFormatOptions" title="GMimeFormatOptions"><span class="type">GMimeFormatOptions</span></a> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>phrase</p></td>
<td class="parameter_description"><p>phrase to encode</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>charset</p></td>
<td class="parameter_description"><p>the charset to use or <code class="literal">NULL</code> to use the default. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-header-encode-phrase.returns"></a><h4>Returns</h4>
<p> the encoded 'phrase'. Useful for encoding internet
addresses.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-structured-header-fold"></a><h3>g_mime_utils_structured_header_fold ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_structured_header_fold (<em class="parameter"><code><a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> *options</code></em>,
                                     <em class="parameter"><code><a class="link" href="gmime-GMimeFormatOptions.html#GMimeFormatOptions" title="GMimeFormatOptions"><span class="type">GMimeFormatOptions</span></a> *format</code></em>,
                                     <em class="parameter"><code>const <span class="type">char</span> *header</code></em>);</pre>
<p>Folds a structured header according to the rules in rfc822.</p>
<div class="refsect3">
<a name="g-mime-utils-structured-header-fold.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>options</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-GMimeFormatOptions.html#GMimeFormatOptions" title="GMimeFormatOptions"><span class="type">GMimeFormatOptions</span></a> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>header</p></td>
<td class="parameter_description"><p>header field and value string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-structured-header-fold.returns"></a><h4>Returns</h4>
<p> an allocated string containing the folded header.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-unstructured-header-fold"></a><h3>g_mime_utils_unstructured_header_fold ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_unstructured_header_fold (<em class="parameter"><code><a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> *options</code></em>,
                                       <em class="parameter"><code><a class="link" href="gmime-GMimeFormatOptions.html#GMimeFormatOptions" title="GMimeFormatOptions"><span class="type">GMimeFormatOptions</span></a> *format</code></em>,
                                       <em class="parameter"><code>const <span class="type">char</span> *header</code></em>);</pre>
<p>Folds an unstructured header according to the rules in rfc822.</p>
<div class="refsect3">
<a name="g-mime-utils-unstructured-header-fold.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>options</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-GMimeParserOptions.html#GMimeParserOptions" title="GMimeParserOptions"><span class="type">GMimeParserOptions</span></a> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-GMimeFormatOptions.html#GMimeFormatOptions" title="GMimeFormatOptions"><span class="type">GMimeFormatOptions</span></a> or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/nullable"><span class="acronym">nullable</span></a>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>header</p></td>
<td class="parameter_description"><p>header field and value string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-unstructured-header-fold.returns"></a><h4>Returns</h4>
<p> an allocated string containing the folded header.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-utils-header-unfold"></a><h3>g_mime_utils_header_unfold ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *
g_mime_utils_header_unfold (<em class="parameter"><code>const <span class="type">char</span> *value</code></em>);</pre>
<p>Unfolds a raw header value according to the rules in rfc822.</p>
<div class="refsect3">
<a name="g-mime-utils-header-unfold.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>raw header value</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-utils-header-unfold.returns"></a><h4>Returns</h4>
<p> an allocated string containing the unfolded header value.</p>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>